package com.lglbc.strategy;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author： 乐哥聊编程(全平台同号)
 * @date: 2022/5/25
 */
public class Client {
    public static void main(String[] args) {
        List<AbstractStrategy> strategies= new ArrayList<>();
        strategies.add(new ConcreteStrategyA());
        strategies.add(new ConcreteStrategyB());
        Map<String,AbstractStrategy> strategyMap = new HashMap<>();
        strategies.forEach(strategy->strategyMap.put(strategy.type,strategy));
        strategyMap.get("concreteStrategyA").strategyMethod();
        strategyMap.get("concreteStrategyB").strategyMethod();

    }
}
